//
//  AppDelegate.swift
//  chendong微博
//
//  Created by chen dong on 2021/3/16.
//

import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {


    private func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject:AnyObject]?) -> Bool {
        // Override point for customization after application launch.
      
        return true
    }


}

// 从服务器加载应用信息
extension AppDelegate {
    private func loadAppInfo() {
        //模拟异步
        DispatchQueue.global().async {
            let url = Bundle.main.url(forResource: "", withExtension: nil)
            
            let data = NSData(contentsOf: url!)
            //写入磁盘
            let docDir = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0]
            //
            let jsonPath = (docDir as NSString).appendingPathComponent("")
            
            data?.write(toFile: jsonPath, atomically: true)
            
        }
    }
}


